home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 11
/
CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso
/
cucd
/
programming
/
oberonv4
/
source
/
system
/
moremathl.mod
(
.txt
)
< prev
next >
Wrap
Oberon Text
|
1995-10-30
|
5KB
|
88 lines
Syntax10.Scn.Fnt
ParcElems
Alloc
Syntax24b.Scn.Fnt
Syntax10b.Scn.Fnt
InfoElems
Alloc
Syntax10.Scn.Fnt
StampElems
Alloc
8 Feb 95
"Title": MoreMathL
"Author": Christoph Steindl (CS)
"Abstract": Implementation of the mathematical functions not exported by MathL. The previously used
MathLib shipped with the Metrowerks C-Compiler was slow and inaccurate.
"Keywords": trigonimetric functions, inverse trigonometric functions, hyperbolic functions, inverse
hyperbolic functions, IEEE floating-point format
"Version": 1.0
"From": 11.11.94 15:40:26
"Until":
"Changes":
"Hints": This text can again contain arbitrary text elements!
Syntax10i.Scn.Fnt
FoldElems
(* AMIGA *)
MODULE MoreMathL;
(* Christoph Steindl (CS), 11.11.94, AMIGA Ralf Degner (RD) 15.7.95 *)
IMPORT SYSTEM, MathL;
CONST
piOver2 = MathL.pi / 2;
PROCEDURE -ulr
04EH, 05EH, 04EH, 075H; (* ULNK A6; RTS *)
PROCEDURE -ftan
0F2H, 02EH, 054H, 00FH, 0000H, 008H; (* FTAN.D (8, A6), FP0 *)
PROCEDURE -fcot
(* 1/tan(x) *)
0F2H, 000H, 05CH, 032H, (* FMOVECR.X $ 00000032, FP0 *)
0F2H, 02EH, 054H, 08FH, 0000H, 008H, (* FTAN.D (8, A6), FP1 *)
0F2H, 000H, 004H, 020H; (* FDIV.X FP1, FP0 *)
PROCEDURE -fasin
0F2H, 02EH, 054H, 00CH, 0000H, 008H; (* FASIN.D (8, A6), FP0 *)
PROCEDURE -facos
0F2H, 02EH, 054H, 01CH, 0000H, 008H; (* FACOS.D (8, A6), FP0 *)
PROCEDURE -ftanh
0F2H, 02EH, 054H, 009H, 0000H, 008H; (* FTANH.D (8, A6), FP0 *)
PROCEDURE -fsinh
0F2H, 02EH, 054H, 002H, 0000H, 008H; (* FSINH.D (8, A6), FP0 *)
PROCEDURE -fcosh
0F2H, 02EH, 054H, 019H, 0000H, 008H; (* FCOSH.D (8, A6), FP0 *)
PROCEDURE -fatanh
0F2H, 02EH, 054H, 00DH, 0000H, 008H; (* FATANH.D (8, A6), FP0 *)
PROCEDURE -facoth
(* atanh(1/x) *)
0F2H, 000H, 05CH, 032H, (* FMOVECR.X $ 00000032, FP0 *)
0F2H, 02EH, 054H, 020H, 0000H, 008H, (* FDIV.D (8, A6), FP0 *)
0F2H, 000H, 000H, 00DH; (* FATANH.X FP0, FP0 *)
PROCEDURE tan* (x: LONGREAL): LONGREAL;
BEGIN ftan; ulr END tan;
PROCEDURE cot* (x: LONGREAL): LONGREAL;
BEGIN fcot; ulr END cot;
PROCEDURE arcsin* (x: LONGREAL): LONGREAL;
BEGIN fasin; ulr END arcsin;
PROCEDURE arccot* (x: LONGREAL): LONGREAL;
BEGIN RETURN piOver2 - MathL.arctan(x) END arccot;
PROCEDURE arccos* (x: LONGREAL): LONGREAL;
BEGIN facos; ulr END arccos;
PROCEDURE tanh* (x: LONGREAL): LONGREAL;
BEGIN ftanh; ulr END tanh;
PROCEDURE sinh* (x: LONGREAL): LONGREAL;
BEGIN fsinh; ulr END sinh;
PROCEDURE cosh* (x: LONGREAL): LONGREAL;
BEGIN fcosh; ulr END cosh;
PROCEDURE coth* (x: LONGREAL): LONGREAL;
VAR e1, e2: LONGREAL;
BEGIN
e1 := MathL.exp(x); e2 := 1 / e1;
RETURN (e1 + e2) / (e1 - e2)
END coth;
PROCEDURE arctanh* (x: LONGREAL): LONGREAL;
BEGIN fatanh; ulr END arctanh;
PROCEDURE arcsinh* (x: LONGREAL): LONGREAL;
BEGIN RETURN arctanh(x / MathL.sqrt(1 + x * x)) END arcsinh;
PROCEDURE arcosh* (x: LONGREAL): LONGREAL;
BEGIN RETURN arctanh(MathL.sqrt(x * x - 1) / x) END arcosh;
PROCEDURE arcoth* (x: LONGREAL): LONGREAL;
BEGIN facoth; ulr END arcoth;
END MoreMathL.Mod